#include <crbprofiler.hpp>

private ["_pos", "_trigarea", "_trigact", "_trigstatem", "_trigger"];
//diag_log format["mso_core_fnc_createTrigger: %1",_this];

CRBPROFILERSTART("mso_core_fnc_createTrigger");

_pos = _this select 0;
_trigarea = _this select 1;
_trigact = _this select 2;
_trigstatem = _this select 3;
_trigger = createTrigger ["EmptyDetector" ,_pos];
_trigger setTriggerArea _trigarea;
_trigger setTriggerActivation _trigact;
_trigger setTriggerStatements _trigstatem;
If (count _this > 4) then {
	If (typename(_this select 4) == "STRING") then { _trigger setTriggerText (_this select 4); };
};

CRBPROFILERSTOP;

_trigger;
